#include<iostream>
#include<vector>
using namespace std;
int main()
{
	int x, n;
	cin >> x >> n;
	int m = 0;
	vector<bool> week = {false,true,true,true,true,true,false};
	for (int i = x; i < n + x; ++i)
	{
		int j = i % 7;
		if (week[j]) m += 250;
	}
	cout << m << endl;
	return 0;
}